home *** CD-ROM | disk | FTP | other *** search
/ The Games Machine 76 / XENIATGM66.iso / Indiana Jones / Indiana Jones.exe / RESOURCE / PREVIEW.GOB / cog_shs_lndoor1.cog < prev    next >
Text File  |  1999-11-15  |  2KB  |  95 lines

  1.  # Jones 3D Cog Script
  2. #
  3. # SHS_LNdoor.cog      Make Lil Nave entry door open/close.  
  4. #
  5. # [JWC, SXC]
  6. #
  7. # (C) 1999 LucasArts Entertainment Company LLC. All Rights Reserved
  8. #
  9. # ========================================================================================
  10.  
  11. symbols
  12.  
  13. message activated
  14. message    startup
  15.  
  16. thing    door           
  17. thing   button       
  18. thing    player            local
  19. thing    interpcam
  20.  
  21. int      filter=0         local        # prevent multiple activates    
  22. int        position=0        local        # door position
  23. int     angle=90                    # which way door opens
  24.                                     # give choice of camera (l,c,r)
  25.          
  26.  
  27. end
  28.  
  29. # ========================================================================================
  30.  
  31. code
  32.  
  33.  
  34. startup:
  35.  
  36.     
  37.        SetThingLight(door, '0.2 0.2 0.2', 0.01, 0.01);
  38.     player= GetLocalPlayerThing();
  39.     return;
  40.  
  41. activated:
  42.    
  43.     # TO DO: prevent activating with chalk
  44.     if (GetCurItem(player) != 0) return; # prevents activating with chalk
  45.  
  46.     if ((GetSenderRef() == button) && (filter == 0))
  47.     {
  48.         #Prep...
  49.         SetActorFlags(player, 0x200000);
  50.         StartCutscene(0);
  51.         StopThing(player);
  52.         DeselectWeapon(player);
  53.         DeselectWeaponWait(player);
  54.         
  55.         # Camera stuff
  56.         SetExtCamOffsetToThing(interpCam);
  57.  
  58.         filter=1;
  59.         
  60.         PlayMode(player, 60, 0);
  61.         Sleep(.3); # synch with button
  62.  
  63.         # handle door
  64.         position = 1 - position;
  65.                  
  66.         MoveToFrame(button, 1, 1);
  67.         WaitForStop(button);
  68.                         
  69.         # open and close door
  70.         SetCollideType(door,0);     # make no collision 
  71.         if (position == 1)            # open door
  72.         {
  73.              # move door
  74.             Rotate(door, angle, 1, 1);
  75.             WaitForStop(door);
  76.         }
  77.            
  78.         if (position == 0)             # close door
  79.         {
  80.             Rotate(door, -angle, 1, 1);
  81.             WaitForStop(door);
  82.         }
  83.         
  84.         SetCollideType(door,3);        # resets collision
  85.         MoveToFrame(button, 0, 1);
  86.         WaitForStop(button);
  87.         RestoreExtCam();
  88.         ClearActorFlags(player, 0x200000);
  89.         EndCutscene();
  90.         filter=0;
  91.     }
  92.     return;
  93.     
  94. end
  95.